<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserWithdrawsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_withdraws', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id');
            $table->integer('state')->comment('状态：0-待审核|1-已审核|2-已提现|3-已拒绝');
            $table->string('transaction_no')->comment('交易流水号');
            $table->string('username')->nullable()->comment('提现时用户名');
            $table->string('mobile')->nullable()->comment('提现时手机号码');
            $table->string('card_username')->nullable()->comment('开户账户');
            $table->string('card_bank')->nullable()->comment('银行名称');
            $table->string('bank_subbranch_name')->nullable()->comment('具提支行');
            $table->dateTime('request_time')->nullable()->comment('提现时间');
            $table->float('request_amount',12,2)->nullable()->comment('提现金额');
            $table->float('fee',12,2)->nullable()->comment('提现手术费');
            $table->float('amount_fee',12,2)->nullable()->comment('提现和手术费总额');
            $table->float('current_point',12,2)->nullable()->comment('提现前积分');
            $table->string('remark')->nullable()->comment('备注');
            $table->dateTime('pass_time')->nullable()->comment('审核通过时间');
            $table->dateTime('finished_time')->nullable()->comment('提现完成或已拒绝时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_withdraws');
    }
}
